/*
 * jdbc-trace-wrapper
 * Copyright (C) 2010. The jdbc-trace-wrapper Project
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package nz.jdbcwrapper;

import java.sql.SQLException;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.DatabaseMetaData;

class WrapperDatabaseMetaData implements DatabaseMetaData
{
  final DatabaseMetaData databaseMetaData;
  final Data data;
  final Statistic statistic;
  final long id = Util.id();
  final String prefix;

  WrapperDatabaseMetaData(Data data,
                          Statistic statistic,
                          DatabaseMetaData databaseMetaData)
  {
    this.data = data;
    this.statistic = statistic;
    this.databaseMetaData = databaseMetaData;
    prefix = "[" + data.connection.id + "][" + id + "]";
  }

  public boolean allProceduresAreCallable() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " allProceduresAreCallable()");

    try
    {
      boolean result = databaseMetaData.allProceduresAreCallable();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public boolean allTablesAreSelectable() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " allTablesAreSelectable()");

    try
    {
      boolean result = databaseMetaData.allTablesAreSelectable();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getURL() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getURL()");

    try
    {
      String result = databaseMetaData.getURL();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getUserName() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getUserName()");

    try
    {
      String result = databaseMetaData.getUserName();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean isReadOnly() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " isReadOnly()");

    try
    {
      boolean result = databaseMetaData.isReadOnly();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean nullsAreSortedHigh() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " nullsAreSortedHigh()");

    try
    {
      boolean result = databaseMetaData.nullsAreSortedHigh();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean nullsAreSortedLow() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " nullsAreSortedLow()");

    try
    {
      boolean result = databaseMetaData.nullsAreSortedLow();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean nullsAreSortedAtStart() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " nullsAreSortedAtStart()");

    try
    {
      boolean result = databaseMetaData.nullsAreSortedAtStart();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean nullsAreSortedAtEnd() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " nullsAreSortedAtEnd()");

    try
    {
      boolean result = databaseMetaData.nullsAreSortedAtEnd();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getDatabaseProductName() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDatabaseProductName()");

    try
    {
      String result = databaseMetaData.getDatabaseProductName();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getDatabaseProductVersion() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDatabaseProductVersion()");

    try
    {
      String result = databaseMetaData.getDatabaseProductVersion();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getDriverName() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDriverName()");

    try
    {
      String result = databaseMetaData.getDriverName();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getDriverVersion() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDriverVersion()");

    try
    {
      String result = databaseMetaData.getDriverVersion();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getDriverMajorVersion()
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDriverMajorVersion()");

    int result = databaseMetaData.getDriverMajorVersion();
    if (data.trace >= 2)
      Util.traceEnd(key, String.valueOf(result));

    return result;
  }



  public int getDriverMinorVersion()
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDriverMinorVersion()");

    int result = databaseMetaData.getDriverMinorVersion();
    if (data.trace >= 2)
      Util.traceEnd(key, String.valueOf(result));

    return result;
  }

  public boolean usesLocalFiles() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " usesLocalFiles()");

    try
    {
      boolean result = databaseMetaData.usesLocalFiles();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean usesLocalFilePerTable() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " usesLocalFilePerTable()");

    try
    {
      boolean result = databaseMetaData.usesLocalFilePerTable();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsMixedCaseIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsMixedCaseIdentifiers()");

    try
    {
      boolean result = databaseMetaData.supportsMixedCaseIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean storesUpperCaseIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " storesUpperCaseIdentifiers()");

    try
    {
      boolean result = databaseMetaData.storesUpperCaseIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean storesLowerCaseIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " storesLowerCaseIdentifiers()");

    try
    {
      boolean result = databaseMetaData.storesLowerCaseIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean storesMixedCaseIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " storesMixedCaseIdentifiers()");

    try
    {
      boolean result = databaseMetaData.storesMixedCaseIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsMixedCaseQuotedIdentifiers()");

    try
    {
      boolean result = databaseMetaData.supportsMixedCaseQuotedIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean storesUpperCaseQuotedIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " storesUpperCaseQuotedIdentifiers()");

    try
    {
      boolean result = databaseMetaData.storesUpperCaseQuotedIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean storesLowerCaseQuotedIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " storesLowerCaseQuotedIdentifiers()");

    try
    {
      boolean result = databaseMetaData.storesLowerCaseQuotedIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean storesMixedCaseQuotedIdentifiers() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " storesMixedCaseQuotedIdentifiers()");

    try
    {
      boolean result = databaseMetaData.storesMixedCaseQuotedIdentifiers();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getIdentifierQuoteString() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getIdentifierQuoteString()");

    try
    {
      String result = databaseMetaData.getIdentifierQuoteString();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getSQLKeywords() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSQLKeywords()");

    try
    {
      String result = databaseMetaData.getSQLKeywords();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getNumericFunctions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getNumericFunctions()");

    try
    {
      String result = databaseMetaData.getNumericFunctions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getStringFunctions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getStringFunctions()");

    try
    {
      String result = databaseMetaData.getStringFunctions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getSystemFunctions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSystemFunctions()");

    try
    {
      String result = databaseMetaData.getSystemFunctions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getTimeDateFunctions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getTimeDateFunctions()");

    try
    {
      String result = databaseMetaData.getTimeDateFunctions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getSearchStringEscape() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSearchStringEscape()");

    try
    {
      String result = databaseMetaData.getSearchStringEscape();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getExtraNameCharacters() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getExtraNameCharacters()");

    try
    {
      String result = databaseMetaData.getExtraNameCharacters();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }




  public boolean supportsAlterTableWithAddColumn() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsAlterTableWithAddColumn()");

    try
    {
      boolean result = databaseMetaData.supportsAlterTableWithAddColumn();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsAlterTableWithDropColumn() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsAlterTableWithDropColumn()");

    try
    {
      boolean result = databaseMetaData.supportsAlterTableWithDropColumn();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsColumnAliasing() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsColumnAliasing()");

    try
    {
      boolean result = databaseMetaData.supportsColumnAliasing();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean nullPlusNonNullIsNull() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " nullPlusNonNullIsNull()");

    try
    {
      boolean result = databaseMetaData.nullPlusNonNullIsNull();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsConvert() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsConvert()");

    try
    {
      boolean result = databaseMetaData.supportsConvert();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsConvert(int fromType, int toType) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsConvert()");

    try
    {
      boolean result = databaseMetaData.supportsConvert(fromType, toType);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsTableCorrelationNames() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsTableCorrelationNames()");

    try
    {
      boolean result = databaseMetaData.supportsTableCorrelationNames();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsDifferentTableCorrelationNames() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsDifferentTableCorrelationNames()");

    try
    {
      boolean result = databaseMetaData.supportsDifferentTableCorrelationNames();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsExpressionsInOrderBy() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsExpressionsInOrderBy()");

    try
    {
      boolean result = databaseMetaData.supportsExpressionsInOrderBy();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsOrderByUnrelated() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsOrderByUnrelated()");

    try
    {
      boolean result = databaseMetaData.supportsOrderByUnrelated();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsGroupBy() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsGroupBy()");

    try
    {
      boolean result = databaseMetaData.supportsGroupBy();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsGroupByUnrelated() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsGroupByUnrelated()");

    try
    {
      boolean result = databaseMetaData.supportsGroupByUnrelated();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsGroupByBeyondSelect() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsGroupByBeyondSelect()");

    try
    {
      boolean result = databaseMetaData.supportsGroupByBeyondSelect();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsLikeEscapeClause() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsLikeEscapeClause()");

    try
    {
      boolean result = databaseMetaData.supportsLikeEscapeClause();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsMultipleResultSets() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsMultipleResultSets()");

    try
    {
      boolean result = databaseMetaData.supportsMultipleResultSets();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsMultipleTransactions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsMultipleTransactions()");

    try
    {
      boolean result = databaseMetaData.supportsMultipleTransactions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsNonNullableColumns() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsNonNullableColumns()");

    try
    {
      boolean result = databaseMetaData.supportsNonNullableColumns();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsMinimumSQLGrammar() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsMinimumSQLGrammar()");

    try
    {
      boolean result = databaseMetaData.supportsMinimumSQLGrammar();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsCoreSQLGrammar() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsCoreSQLGrammar()");

    try
    {
      boolean result = databaseMetaData.supportsCoreSQLGrammar();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsExtendedSQLGrammar() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsExtendedSQLGrammar()");

    try
    {
      boolean result = databaseMetaData.supportsExtendedSQLGrammar();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsANSI92EntryLevelSQL() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsANSI92EntryLevelSQL()");

    try
    {
      boolean result = databaseMetaData.supportsANSI92EntryLevelSQL();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsANSI92IntermediateSQL() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsANSI92IntermediateSQL()");

    try
    {
      boolean result = databaseMetaData.supportsANSI92IntermediateSQL();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsANSI92FullSQL() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsANSI92FullSQL()");

    try
    {
      boolean result = databaseMetaData.supportsANSI92FullSQL();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsIntegrityEnhancementFacility() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsIntegrityEnhancementFacility()");

    try
    {
      boolean result = databaseMetaData.supportsIntegrityEnhancementFacility();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsOuterJoins() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsOuterJoins()");

    try
    {
      boolean result = databaseMetaData.supportsOuterJoins();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsFullOuterJoins() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsFullOuterJoins()");

    try
    {
      boolean result = databaseMetaData.supportsFullOuterJoins();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsLimitedOuterJoins() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsLimitedOuterJoins()");

    try
    {
      boolean result = databaseMetaData.supportsLimitedOuterJoins();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getSchemaTerm() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSchemaTerm()");

    try
    {
      String result = databaseMetaData.getSchemaTerm();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getProcedureTerm() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getProcedureTerm()");

    try
    {
      String result = databaseMetaData.getProcedureTerm();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getCatalogTerm() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getCatalogTerm()");

    try
    {
      String result = databaseMetaData.getCatalogTerm();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean isCatalogAtStart() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " isCatalogAtStart()");

    try
    {
      boolean result = databaseMetaData.isCatalogAtStart();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public String getCatalogSeparator() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getCatalogSeparator()");

    try
    {
      String result = databaseMetaData.getCatalogSeparator();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSchemasInDataManipulation() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSchemasInDataManipulation()");

    try
    {
      boolean result = databaseMetaData.supportsSchemasInDataManipulation();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSchemasInProcedureCalls() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSchemasInProcedureCalls()");

    try
    {
      boolean result = databaseMetaData.supportsSchemasInProcedureCalls();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSchemasInTableDefinitions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSchemasInTableDefinitions()");

    try
    {
      boolean result = databaseMetaData.supportsSchemasInTableDefinitions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSchemasInIndexDefinitions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSchemasInIndexDefinitions()");

    try
    {
      boolean result = databaseMetaData.supportsSchemasInIndexDefinitions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSchemasInPrivilegeDefinitions()");

    try
    {
      boolean result = databaseMetaData.supportsSchemasInPrivilegeDefinitions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsCatalogsInDataManipulation() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsCatalogsInDataManipulation()");

    try
    {
      boolean result = databaseMetaData.supportsCatalogsInDataManipulation();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsCatalogsInProcedureCalls() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsCatalogsInProcedureCalls()");

    try
    {
      boolean result = databaseMetaData.supportsCatalogsInProcedureCalls();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsCatalogsInTableDefinitions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsCatalogsInTableDefinitions()");

    try
    {
      boolean result = databaseMetaData.supportsCatalogsInTableDefinitions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsCatalogsInIndexDefinitions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsCatalogsInIndexDefinitions()");

    try
    {
      boolean result = databaseMetaData.supportsCatalogsInIndexDefinitions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsCatalogsInPrivilegeDefinitions()");

    try
    {
      boolean result = databaseMetaData.supportsCatalogsInPrivilegeDefinitions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }




  public boolean supportsPositionedDelete() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsPositionedDelete()");

    try
    {
      boolean result = databaseMetaData.supportsPositionedDelete();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsPositionedUpdate() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsPositionedUpdate()");

    try
    {
      boolean result = databaseMetaData.supportsPositionedUpdate();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSelectForUpdate() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSelectForUpdate()");

    try
    {
      boolean result = databaseMetaData.supportsSelectForUpdate();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsStoredProcedures() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsStoredProcedures()");

    try
    {
      boolean result = databaseMetaData.supportsStoredProcedures();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSubqueriesInComparisons() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSubqueriesInComparisons()");

    try
    {
      boolean result = databaseMetaData.supportsSubqueriesInComparisons();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSubqueriesInExists() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSubqueriesInExists()");

    try
    {
      boolean result = databaseMetaData.supportsSubqueriesInExists();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSubqueriesInIns() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSubqueriesInIns()");

    try
    {
      boolean result = databaseMetaData.supportsSubqueriesInIns();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsSubqueriesInQuantifieds() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSubqueriesInQuantifieds()");

    try
    {
      boolean result = databaseMetaData.supportsSubqueriesInQuantifieds();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsCorrelatedSubqueries() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsCorrelatedSubqueries()");

    try
    {
      boolean result = databaseMetaData.supportsCorrelatedSubqueries();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsUnion() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsUnion()");

    try
    {
      boolean result = databaseMetaData.supportsUnion();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsUnionAll() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsUnionAll()");

    try
    {
      boolean result = databaseMetaData.supportsUnionAll();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsOpenCursorsAcrossCommit() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsOpenCursorsAcrossCommit()");

    try
    {
      boolean result = databaseMetaData.supportsOpenCursorsAcrossCommit();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsOpenCursorsAcrossRollback() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsOpenCursorsAcrossRollback()");

    try
    {
      boolean result = databaseMetaData.supportsOpenCursorsAcrossRollback();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsOpenStatementsAcrossCommit() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsOpenStatementsAcrossCommit()");

    try
    {
      boolean result = databaseMetaData.supportsOpenStatementsAcrossCommit();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsOpenStatementsAcrossRollback() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsOpenStatementsAcrossRollback()");

    try
    {
      boolean result = databaseMetaData.supportsOpenStatementsAcrossRollback();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }






  public int getMaxBinaryLiteralLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxBinaryLiteralLength()");

    try
    {
      int result = databaseMetaData.getMaxBinaryLiteralLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxCharLiteralLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxCharLiteralLength()");

    try
    {
      int result = databaseMetaData.getMaxCharLiteralLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxColumnNameLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxColumnNameLength()");

    try
    {
      int result = databaseMetaData.getMaxColumnNameLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxColumnsInGroupBy() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxColumnsInGroupBy()");

    try
    {
      int result = databaseMetaData.getMaxColumnsInGroupBy();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxColumnsInIndex() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxColumnsInIndex()");

    try
    {
      int result = databaseMetaData.getMaxColumnsInIndex();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxColumnsInOrderBy() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxColumnsInOrderBy()");

    try
    {
      int result = databaseMetaData.getMaxColumnsInOrderBy();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxColumnsInSelect() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxColumnsInSelect()");

    try
    {
      int result = databaseMetaData.getMaxColumnsInSelect();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxColumnsInTable() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxColumnsInTable()");

    try
    {
      int result = databaseMetaData.getMaxColumnsInTable();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxConnections() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxConnections()");

    try
    {
      int result = databaseMetaData.getMaxConnections();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxCursorNameLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxCursorNameLength()");

    try
    {
      int result = databaseMetaData.getMaxCursorNameLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxIndexLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxIndexLength()");

    try
    {
      int result = databaseMetaData.getMaxIndexLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxSchemaNameLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxSchemaNameLength()");

    try
    {
      int result = databaseMetaData.getMaxSchemaNameLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxProcedureNameLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxProcedureNameLength()");

    try
    {
      int result = databaseMetaData.getMaxProcedureNameLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxCatalogNameLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxCatalogNameLength()");

    try
    {
      int result = databaseMetaData.getMaxCatalogNameLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxRowSize() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxRowSize()");

    try
    {
      int result = databaseMetaData.getMaxRowSize();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean doesMaxRowSizeIncludeBlobs() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " doesMaxRowSizeIncludeBlobs()");

    try
    {
      boolean result = databaseMetaData.doesMaxRowSizeIncludeBlobs();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxStatementLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxStatementLength()");

    try
    {
      int result = databaseMetaData.getMaxStatementLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxStatements() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxStatements()");

    try
    {
      int result = databaseMetaData.getMaxStatements();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxTableNameLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxTableNameLength()");

    try
    {
      int result = databaseMetaData.getMaxTableNameLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxTablesInSelect() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxTablesInSelect()");

    try
    {
      int result = databaseMetaData.getMaxTablesInSelect();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public int getMaxUserNameLength() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getMaxUserNameLength()");

    try
    {
      int result = databaseMetaData.getMaxUserNameLength();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }




  public int getDefaultTransactionIsolation() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDefaultTransactionIsolation()");

    try
    {
      int result = databaseMetaData.getDefaultTransactionIsolation();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsTransactions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsTransactions()");

    try
    {
      boolean result = databaseMetaData.supportsTransactions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsTransactionIsolationLevel(int level) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsTransactionIsolationLevel(" + level + ")");

    try
    {
      boolean result = databaseMetaData.supportsTransactionIsolationLevel(level);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsDataDefinitionAndDataManipulationTransactions()");

    try
    {
      boolean result = databaseMetaData.supportsDataDefinitionAndDataManipulationTransactions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }


  public boolean supportsDataManipulationTransactionsOnly() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsDataManipulationTransactionsOnly()");

    try
    {
      boolean result = databaseMetaData.supportsDataManipulationTransactionsOnly();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }


  public boolean dataDefinitionCausesTransactionCommit() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " dataDefinitionCausesTransactionCommit()");

    try
    {
      boolean result = databaseMetaData.dataDefinitionCausesTransactionCommit();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }


  public boolean dataDefinitionIgnoredInTransactions() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " dataDefinitionIgnoredInTransactions()");

    try
    {
      boolean result = databaseMetaData.dataDefinitionIgnoredInTransactions();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getProcedures(String catalog,
                                 String schemaPattern,
                                 String procedureNamePattern) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getProcedures(" + catalog + ", " +
                         schemaPattern + ", " + procedureNamePattern + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getProcedures(
        catalog, schemaPattern, procedureNamePattern));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getProcedureColumns(String catalog,
                                       String schemaPattern,
                                       String procedureNamePattern,
                                       String columnNamePattern) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getProcedureColumns(" +
                            catalog + ", " +
                            schemaPattern + ", " +
                            procedureNamePattern + ", " +
                            columnNamePattern + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
        data, null, statistic, prefix, databaseMetaData.getProcedureColumns(
          catalog, schemaPattern, procedureNamePattern, columnNamePattern));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getTables(String catalog,
                             String schemaPattern,
                             String tableNamePattern,
                             String types[]) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getTables(" + catalog + ", " +
                 schemaPattern + ", " +
                 tableNamePattern + ", " +
                 (types == null ? "null" : "types[" + types.length + "]") +
                 ")");
    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getTables(
        catalog, schemaPattern, tableNamePattern, types));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public ResultSet getSchemas() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSchemas()");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getSchemas());

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getCatalogs() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getCatalogs()");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(data, null, statistic, prefix, databaseMetaData.getCatalogs());

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public ResultSet getTableTypes() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getTableTypes()");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(data, null, statistic, prefix, databaseMetaData.getTableTypes());

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getColumns(String catalog,
                              String schemaPattern,
                              String tableNamePattern,
                              String columnNamePattern) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getColumns(" + catalog + ", " +
                            schemaPattern + ", " +
                            tableNamePattern + ", " +
                            columnNamePattern + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getColumns(
        catalog, schemaPattern, tableNamePattern, columnNamePattern));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getColumnPrivileges(String catalog,
                                       String schema,
                                       String table,
                                       String columnNamePattern) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getColumnPrivileges(" +
                            catalog + "," +
                            schema + "," +
                            table + "," +
                            columnNamePattern + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getColumnPrivileges(
        catalog, schema, table, columnNamePattern));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public ResultSet getTablePrivileges(String catalog,
                                      String schemaPattern,
                                      String tableNamePattern) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getTablePrivileges(" +
                            catalog + "," +
                            schemaPattern + "," +
                            tableNamePattern + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getTablePrivileges(
        catalog, schemaPattern, tableNamePattern));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getBestRowIdentifier(String catalog,
                                        String schema,
                                        String table,
                                        int scope,
                                        boolean nullable) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getBestRowIdentifier(" +
                            catalog + "," +
                            schema + "," +
                            table + "," +
                            scope + "," +
                            nullable + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getBestRowIdentifier(
        catalog, schema, table, scope, nullable));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getVersionColumns(String catalog,
                                     String schema,
                                     String table) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getVersionColumns(" +
                            catalog + "," +
                            schema + "," +
                            table + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
        data, null, statistic, prefix,
        databaseMetaData.getVersionColumns(catalog, schema, table));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getPrimaryKeys(String catalog,
                                  String schema,
                                  String table) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getPrimaryKeys(" +
                            catalog + "," +
                            schema + "," +
                            table + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
        data, null, statistic, prefix,
        databaseMetaData.getPrimaryKeys(catalog, schema, table));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getImportedKeys(String catalog,
                                   String schema,
                                   String table) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getImportedKeys(" +
                            catalog + "," +
                            schema + "," +
                            table + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
        data, null, statistic, prefix,
        databaseMetaData.getImportedKeys(catalog, schema, table));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getExportedKeys(String catalog,
                                   String schema,
                                   String table) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getExportedKeys(" +
                            catalog + "," +
                            schema + "," +
                            table + ")");

      try
      {
        WrapperResultSet resultSet = WrapperResultSet.build(data, null, statistic, prefix, databaseMetaData.getExportedKeys(
        catalog, schema, table));

        if (data.trace >= 2)
          Util.traceEnd(key, resultSet.prefix);

        return resultSet;
      }
      catch (SQLException e)
      {
        if (data.trace >= 2)
          Util.traceEnd(key, e);
        throw e;
      }
  }

  public ResultSet getCrossReference(String primaryCatalog,
                                     String primarySchema,
                                     String primaryTable,
                                     String foreignCatalog,
                                     String foreignSchema,
                                     String foreignTable
  ) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getCrossReference(" +
                            primaryCatalog + "," +
                            primarySchema + "," +
                            primaryTable + "," +
                            foreignCatalog + "," +
                            foreignSchema + "," +
                            foreignTable + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getCrossReference(
        primaryCatalog, primarySchema, primaryTable,
        foreignCatalog, foreignSchema, foreignTable));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getTypeInfo() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getTypeInfo()");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(data, null, statistic, prefix, databaseMetaData.getTypeInfo());

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public ResultSet getIndexInfo(String catalog,
                                String schema,
                                String table,
                                boolean unique,
                                boolean approximate) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getIndexInfo(" +
                            catalog + "," +
                            schema + "," +
                            table + "," +
                            unique + "," +
                            approximate + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
      data, null, statistic, prefix, databaseMetaData.getIndexInfo(
        catalog, schema, table, unique, approximate));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public boolean supportsResultSetType(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsResultSetType(" + type + ")");

    try
    {
      boolean result = databaseMetaData.supportsResultSetType(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsResultSetConcurrency(" +
                            type + ", " +
                            concurrency + ")");

    try
    {
      boolean result = databaseMetaData.supportsResultSetConcurrency(type, concurrency);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean ownUpdatesAreVisible(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " ownUpdatesAreVisible(" + type + ")");

    try
    {
      boolean result = databaseMetaData.ownUpdatesAreVisible(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean ownDeletesAreVisible(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " ownDeletesAreVisible(" + type + ")");

    try
    {
      boolean result = databaseMetaData.ownDeletesAreVisible(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean ownInsertsAreVisible(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " ownInsertsAreVisible(" + type + ")");

    try
    {
      boolean result = databaseMetaData.ownInsertsAreVisible(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean othersUpdatesAreVisible(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " othersUpdatesAreVisible(" + type + ")");

    try
    {
      boolean result = databaseMetaData.othersUpdatesAreVisible(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean othersDeletesAreVisible(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " othersDeletesAreVisible(" + type + ")");

    try
    {
      boolean result = databaseMetaData.othersDeletesAreVisible(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean othersInsertsAreVisible(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " othersInsertsAreVisible(" + type + ")");

    try
    {
      boolean result = databaseMetaData.othersInsertsAreVisible(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean updatesAreDetected(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " updatesAreDetected(" + type + ")");

    try
    {
      boolean result = databaseMetaData.updatesAreDetected(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean deletesAreDetected(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " deletesAreDetected(" + type + ")");

    try
    {
      boolean result = databaseMetaData.deletesAreDetected(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean insertsAreDetected(int type) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " insertsAreDetected(" + type + ")");

    try
    {
      boolean result = databaseMetaData.insertsAreDetected(type);
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public boolean supportsBatchUpdates() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsBatchUpdates()");

    try
    {
      boolean result = databaseMetaData.supportsBatchUpdates();
      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));

      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }



  public ResultSet getUDTs(String catalog,
                           String schemaPattern,
                           String typeNamePattern,
                           int[] types) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getUDTs(" +
                            catalog + "," +
                            schemaPattern + "," +
                            typeNamePattern + "," +
                            (types == null
                             ? "null"
                             : "types[" + types.length + "]") + ")");

    try
    {
      WrapperResultSet resultSet = WrapperResultSet.build(
        data, null, statistic, prefix, databaseMetaData.getUDTs(
          catalog, schemaPattern, typeNamePattern, types));

      if (data.trace >= 2)
        Util.traceEnd(key, resultSet.prefix);

      return resultSet;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  public Connection getConnection() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getConnection()");

    try
    {
      Connection result = databaseMetaData.getConnection();

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }
  /**
   * @see java.sql.DatabaseMetaData#getAttributes(String, String, String, String)
   */
  public ResultSet getAttributes(
    String catalog,
    String schemaPattern,
    String typeNamePattern,
    String attributeNamePattern)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getAttributes(" +
                            catalog + ", " +
                            schemaPattern + ", " +
                            typeNamePattern + ", " +
                            attributeNamePattern + ")");

    try
    {
      ResultSet result = databaseMetaData.getAttributes(
        catalog, schemaPattern, typeNamePattern, attributeNamePattern);

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getDatabaseMajorVersion()
   */
  public int getDatabaseMajorVersion() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDatabaseMajorVersion()");

    try
    {
      int result = databaseMetaData.getDatabaseMajorVersion();

      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getDatabaseMinorVersion()
   */
  public int getDatabaseMinorVersion() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getDatabaseMinorVersion()");

    try
    {
      int result = databaseMetaData.getDatabaseMinorVersion();

      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getJDBCMajorVersion()
   */
  public int getJDBCMajorVersion() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getJDBCMajorVersion()");

    try
    {
      int result = databaseMetaData.getJDBCMajorVersion();

      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getJDBCMinorVersion()
   */
  public int getJDBCMinorVersion() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getJDBCMinorVersion()");

    try
    {
      int result = databaseMetaData.getJDBCMinorVersion();

      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getResultSetHoldability()
   */
  public int getResultSetHoldability() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getResultSetHoldability()");

    try
    {
      int result = databaseMetaData.getResultSetHoldability();

      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getSQLStateType()
   */
  public int getSQLStateType() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSQLStateType()");

    try
    {
      int result = databaseMetaData.getSQLStateType();

      if (data.trace >= 2)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getSuperTables(String, String, String)
   */
  public ResultSet getSuperTables(
    String catalog,
    String schemaPattern,
    String tableNamePattern)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSuperTables(" +
                            catalog + ", " +
                            schemaPattern + ", " +
                            tableNamePattern + ")");

    try
    {
      ResultSet result = databaseMetaData.getSuperTables(
        catalog, schemaPattern, tableNamePattern);

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#getSuperTypes(String, String, String)
   */
  public ResultSet getSuperTypes(
    String catalog,
    String schemaPattern,
    String typeNamePattern)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " getSuperTypes(" +
                            catalog + ", " +
                            schemaPattern + ", " +
                            typeNamePattern + ")");

    try
    {
      ResultSet result = databaseMetaData.getSuperTypes(
        catalog, schemaPattern, typeNamePattern);

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#locatorsUpdateCopy()
   */
  public boolean locatorsUpdateCopy() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " locatorsUpdateCopy()");

    try
    {
      boolean result = databaseMetaData.locatorsUpdateCopy();

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#supportsGetGeneratedKeys()
   */
  public boolean supportsGetGeneratedKeys() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsGetGeneratedKeys()");

    try
    {
      boolean result = databaseMetaData.supportsGetGeneratedKeys();

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#supportsMultipleOpenResults()
   */
  public boolean supportsMultipleOpenResults() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsMultipleOpenResults()");

    try
    {
      boolean result = databaseMetaData.supportsMultipleOpenResults();

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#supportsNamedParameters()
   */
  public boolean supportsNamedParameters() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsNamedParameters()");

    try
    {
      boolean result = databaseMetaData.supportsNamedParameters();

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#supportsResultSetHoldability(int)
   */
  public boolean supportsResultSetHoldability(int holdability)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsResultSetHoldability(" + holdability + ")");

    try
    {
      boolean result = databaseMetaData.supportsResultSetHoldability(holdability);

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /**
   * @see java.sql.DatabaseMetaData#supportsSavepoints()
   */
  public boolean supportsSavepoints() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsSavepoints()");

    try
    {
      boolean result = databaseMetaData.supportsSavepoints();

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }

  /* (non-Javadoc)
   * @see java.sql.DatabaseMetaData#supportsStatementPooling()
   */
  public boolean supportsStatementPooling() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 2)
      key = Util.traceBegin(prefix + " supportsStatementPooling()");

    try
    {
      boolean result = databaseMetaData.supportsStatementPooling();

      if (data.trace >= 2)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 2)
        Util.traceEnd(key, e);
      throw e;
    }
  }
//  public boolean isWrapperFor(Class<?> iface) throws SQLException
//  {
//      return iface.isInstance(this) || databaseMetaData.isWrapperFor(iface);
//  }
//
//  public <T> T unwrap(Class<T> iface) throws SQLException
//  {
//      return iface.isInstance(this) ? (T)this : databaseMetaData.unwrap(iface);
//  }
//  
//    public ResultSet getClientInfoProperties() throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 4)
//            key = Util.traceBegin(prefix + " getClientInfoProperties()");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            ResultSet result = databaseMetaData.getClientInfoProperties();
//            duration = System.currentTimeMillis() - start;
//
//            WrapperResultSet wrappedResult = WrapperResultSet.build(data, null, statistic, prefix, result);
//            if (data.trace >= 4)
//                Util.traceEnd(key, wrappedResult.prefix);
//            return wrappedResult;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 4)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//    }
//
//    public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 4)
//            key = Util.traceBegin(prefix + " getFunctionColumns(catalog, schemaPattern, functionNamePattern, columnNamePattern)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            ResultSet result = databaseMetaData.getFunctionColumns(catalog, schemaPattern, functionNamePattern, columnNamePattern);
//            duration = System.currentTimeMillis() - start;
//
//            WrapperResultSet wrappedResult = WrapperResultSet.build(data, null, statistic, prefix, result);
//            if (data.trace >= 4)
//                Util.traceEnd(key, wrappedResult.prefix);
//            return wrappedResult;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 4)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//    }
//
//    public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 4)
//            key = Util.traceBegin(prefix + " getFunctions(catalog, schemaPattern, functionNamePattern)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            ResultSet result = databaseMetaData.getFunctions(catalog, schemaPattern, functionNamePattern);
//            duration = System.currentTimeMillis() - start;
//
//            WrapperResultSet wrappedResult = WrapperResultSet.build(data, null, statistic, prefix, result);
//            if (data.trace >= 4)
//                Util.traceEnd(key, wrappedResult.prefix);
//            return wrappedResult;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 4)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//    }
//
//    public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 4)
//            key = Util.traceBegin(prefix + " getSchemas(catalog, schemaPattern)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            ResultSet result = databaseMetaData.getSchemas(catalog, schemaPattern);
//            duration = System.currentTimeMillis() - start;
//
//            WrapperResultSet wrappedResult = WrapperResultSet.build(data, null, statistic, prefix, result);
//            if (data.trace >= 4)
//                Util.traceEnd(key, wrappedResult.prefix);
//            return wrappedResult;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 4)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//    }
//
//    public RowIdLifetime getRowIdLifetime() throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 4)
//            key = Util.traceBegin(prefix + " getRowIdLifetime()");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            RowIdLifetime result = databaseMetaData.getRowIdLifetime();
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 4)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 4)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//    }
//
//    public boolean autoCommitFailureClosesAllResultSets() throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 4)
//            key = Util.traceBegin(prefix + " autoCommitFailureClosesAllResultSets()");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            boolean result = databaseMetaData.autoCommitFailureClosesAllResultSets();
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 4)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 4)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//    }
//
//    public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 4)
//            key = Util.traceBegin(prefix + " supportsStoredFunctionsUsingCallSyntax()");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            boolean result = databaseMetaData.supportsStoredFunctionsUsingCallSyntax();
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 4)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 4)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//    }


}
